<?php
include("connect.php");
$UserID=$_REQUEST['UserID'];
$sql="SELECT Dynamic.DynID,Dynamic.PunTime,Dynamic.PunCon,Activities.ActName FROM Activities,Dynamic where Activities.ActID=Dynamic.ActID AND Dynamic.UserID='".$UserID."'";
mysqli_query($conn,"set names utf8");
$result=mysqli_query($conn,$sql);
$data=array();
class dynamic{
	public $PunTime;
	public $PunCon;
	public $ActName;
	public $DynID;
}
mysqli_query($conn,"set names utf8");

while($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
	$dyn=new dynamic();
	$dyn->DynID=urlencode($row["DynID"]);//将字符串以url编码(主要将中文转化过去
	$dyn->PunTime=urlencode($row["PunTime"]);
	$dyn->PunCon=urlencode($row["PunCon"]);
	$dyn->ActName=urlencode($row["ActName"]);
	$data[]=$dyn;
  
}
array_multisort($data,SORT_DESC );
$json=json_encode($data);//将数值转换成json数据存储格式
echo urldecode($json);
?>